from org.eclipse.ui import ISelectionListener
from data.url_data import UrlData

class SelectionListener(ISelectionListener):
    def __init__(self, browser):
        self.browser = browser
        
    def selectionChanged(self, part, selection):
        selection_data = selection.firstElement
        if isinstance(selection_data, UrlData):
            self.browser.url = selection_data.url
    